package com.sdwl.brcl.validation.validation;

/**
 * @author xied
 * @date 2021年06月11日 14:15
 */
public class RegexValidator implements Validator {
    public RegexValidator() {
    }

    @Override
    public boolean validate(Object value) {
        String[] values = (String[])((String[])value);
        return values[0].matches(values[1]);
    }

    @Override
    public String validateCode() {
        return "regex.error";
    }

    @Override
    public String validateMsg(Object value, String validateName) {
        return validateName + "格式不正确";
    }
}
